<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>住院记录详情</title>
    <%- include('../_global/baseLibsJKDA') %>
    <link rel="stylesheet" href="/static/css/jkda/page-main.css"/>
    <link rel="stylesheet" href="/static/css/public.css">
    <script src="/static/js/<%=type%>/pageUrl.js"></script>
     <script src="/static/js/<%=type%>/jkda.js"></script>
<style type="text/css">
html,body {
	width: 100%;
	height: 100%;
    margin: 0px;
    background: #fff;
} 
table{
    margin: 1rem 0;
}
tr th,td{
    text-align: center;
}
tr td{
    border-bottom: 1px solid #eee;
}
.bg_white{
    background: #fff;
}
</style>

</head>

<body>
    <header class="header-box grey fixed">
        <div class="header-content">
            <div class="left-tool">
                <a class="back" href="javascript:void(0);"><i class="iconfont icon-back"></i></a>
            </div>
            <div class="title">住院记录详情</div>
        </div>
    </header>
	<section class="page-clinic-details bg_white">
    <ul class="detail zyDetail">
        <li class="t-box">
           <i class="detail-icon j-1"></i><h3>住院信息</h3>
          <div id="Mzxx">
                <li>医院:<span name="hosName"></span></li>
                <li>入院时间:<span name="startDate"></span></li>
                <li>出院时间:<span name="endDate"></span></li>
          </div>
        </li>
        </li>
    </ul>
    <ul class="detail">
            <li class="t-box">
                <i class="detail-icon j-1"></i><h3>药品信息</h3>
                <div>
                
                </div>
            </li>
            <div id="zyMedicine">
                   
            </div>
    </ul>
    <ul class="detail">
        <li class="t-box">
            <i class="detail-icon j-1"></i><h3>出院小结报告</h3>
            <div id="Cyxjbg">
                
            </div>
         </li> 
    </ul>
</section>
</body>
<script type="text/javascript">


    var page_zyDetail = (function($, page_zyDetail) {


        var cfg_def = {
            initdata: initdata,
            queryZysxq: queryZysxq,
            getReport: getReport,
        }

        page_zyDetail.init = function(cfg){
            $.extend(page_zyDetail, cfg_def, cfg);
            page_zyDetail.initdata();

        }

        return page_zyDetail;
        function initdata(){
            // var EID = $.JkdaUtils.decryptStr("fjzlyd-jkda-yddy",$.QuickUrlUtils.getRequest("JKDAEID"));
            // var zxwyh = $.QuickUrlUtils.getRequest("ZXWYH");
            var info = StoreCache.getCache("zyInfo");
            $(".zyDetail").find("span").each(function(){
                $(this).text(info[$(this).attr("name")]);
            });
            console.log(info);
            var zxwyh=$.QuickUrlUtils.getRequest("ZXWYH");
            var serialNumber=info.serialNum;
            var hosOrgCode=info.hosCode;
            //获取住院药品信息
            $.QuickRemote.AjaxJson(
                $.getMyorderUrl.getpageUrl("queryZysxq"),
                page_zyDetail.queryZysxq,
                {
                    "zxwyh": zxwyh,
                    "serialNumber":serialNumber, //就诊流水号
                    "hosOrgCode": hosOrgCode, //医疗机构代码
                }
            )
            //获取出院小结
            $.QuickRemote.AjaxJson(
                $.getMyorderUrl.getpageUrl("getReport"),
                page_zyDetail.getReport,
                {
                    "zxwyh": zxwyh,
                    "serialNumber":serialNumber, //就诊流水号
                    "hosOrgCode": hosOrgCode, //医疗机构代码
                }
            )
        }
        function queryZysxq(response){
            $("#zyMedicine").html(template("Medicine", {data:response}));
        }
        function getReport(response){

        }
    })(jQuery, {});
    
   
</script>
<script type="text/html" id="Medicine">
    {{each data}}
    <table>
        <tr>
            <th>服药量</th>
            <th>用法</th>
            <th>药品名称</th>
            <th>用药量</th>
            <th>用药频次</th>
        </tr>
        <tr>
            <td width="15%">{{$value.fyl}}</td>
            <td width="20%">{{$value.yf}}</td>
            <td width="30%">{{$value.ypmc}}</td>
            <td width="15%">{{$value.yyl}}</td>
            <td width="20%">{{$value.yypc}}</td>
        </tr>
    </table>
  {{/each}}
</script>
</html>